package com.pj.thread;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author 王存露
 * @date 2021/2/27
 */
public class SimlpThread {
    static  int i = 0;
    static AtomicInteger integer = new AtomicInteger();
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                for (int j = 0; j < 1000000000; j++) {
                    i = j;
                }
            }
        };
        for (int j = 0; j < 1000000000; j++) {
            new Thread(runnable).start();
        }
        Thread.sleep(3000);
        System.out.println(i);
        System.out.println(integer);
    }
}
